]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
tools/toolbox: Support --devkit when running shell
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 12 May 2025 23:18:28 +0000 (01:18 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 27 May 2025 22:21:59 +0000 (00:21 +0200)
It is the modern replacement for nested mode, and does not depend
on the X11 backend that is on its way out.

For now keep support for --nested as a fallback, so the script
keeps working on older branches.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3731>

tools/toolbox/run-gnome-shell.sh

index 349898c779c2c859729107ecb5ac2b8bbdecc3c6..23b1186b57eeb86b31ced2db5f38e3ff93aaafa5 100755 (executable)
@@ -49,6 +49,14 @@ should_run_nested() {
   [[ "$XDG_SESSION_TYPE" != "tty" ]] && [[ ! "$HEADLESS" ]]
 }
 
+has_devkit() {
+  toolbox --container $TOOLBOX run gnome-shell --help | grep -q -- --devkit
+}
+
+has_nested() {
+  toolbox --container $TOOLBOX run gnome-shell --help | grep -q -- --nested
+}
+
 # load defaults
 . $CONFIG_FILE
 TOOLBOX=$DEFAULT_TOOLBOX
@@ -147,15 +155,25 @@ while true; do
   esac
 done
 
+FORCE_DISPLAY=1
 if should_run_nested; then
-  SHELL_ARGS+=( --nested )
+  if has_devkit; then
+    SHELL_ARGS+=( --devkit )
+    FORCE_DISPLAY=0
+  elif has_nested; then
+    SHELL_ARGS+=( --nested )
+  else
+    die Mutter has to be built with devkit or x11 support
+  fi
 else
   SHELL_ARGS+=( --wayland )
 fi
 
-display=toolbox-wayland-$RANDOM
-SHELL_ENV+=(WAYLAND_DISPLAY=$display)
-SHELL_ARGS+=(--wayland-display=$display)
+if [ $FORCE_DISPLAY -gt 0 ]; then
+  display=toolbox-wayland-$RANDOM
+  SHELL_ENV+=(WAYLAND_DISPLAY=$display)
+  SHELL_ARGS+=(--wayland-display=$display)
+fi
 
 toolbox --container $TOOLBOX run \
   env "${SHELL_ENV[@]}" dbus-run-session $GDB gnome-shell "${SHELL_ARGS[@]}"